package HttpBean.Request.RequestImpl;

import HttpBean.Request.RequestEntity;
import HttpBean.Request.RequestLine;

import java.io.IOException;

public class RequestPostStringImpl extends RequestGetStringImpl {
    RequestEntity requestEntity;
    public RequestPostStringImpl(String[] strs, RequestLine requestLine) throws IOException {
        super(strs, requestLine);
        System.out.println(super.toString());
        int len = Integer.valueOf(super.getRequestHead().map.get("Content-Length"));
        String str = "";
        for(int i=0;i<strs.length;i++){
            if (strs[i] == null||strs[i].equals("")||strs[i].isEmpty()){
                str = strs[i+1];
                break;
            }
        }
        this.requestEntity = new RequestEntity(str);
    }

    @Override
    public String toString() {
        return "RequestPostImpl{" +
                "requestHead=" + super.getRequestHead().toString() +
                ", requestLine=" + super.getRequestLine().toString() +
                ", requestEntity=" + requestEntity.toString() +
                '}';
    }
}
